<include file="Public:header" />

<div class="page-content">
    <!-- content starts -->
    <div class="cig-page-header">
        <ul class="breadcrumb">
            <li>
                <a href="{:U('/Problem/index')}">竞赛&作业管理</a>
            </li>

            <li class="active">编辑竞赛&作业</li>
        </ul>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="box-inner">

                <div class="box-content">

                    <div class="row">
                        <div class="col-xs-12">
                            <br />
                            <form class="form-horizontal" action="{:U('/Contest/save')}" method="POST">
                                <input type="hidden" value="{$content['contest_id']}" name="contest-id">
                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Title:</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="col-xs-10 col-sm-5 required" name="title" value="{$content['title']}">
                                        <span class="cig-tip"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Start Time:</label>
                                    <div class="col-sm-10">
                                        <div class="input-group col-sm-5">
                                            <input type="text" value="{$content['start_time']}" name="start-time" id="start-time" class="form-control date-picker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:00' })" >
                                            <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i> </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>End Time:</label>
                                    <div class="col-sm-10">
                                        <div class="input-group col-sm-5">
                                            <input type="text" value="{$content['end_time']}" name="end-time" id="end-time" class="form-control date-picker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:00' })" >
                                            <span class="input-group-addon"> <i class="fa fa-calendar bigger-110"></i> </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Problems:</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="col-xs-10 col-sm-5 required" name="problems" value="{$content['title']}">
                                        <span class="cig-tip"></span>
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Public:</label>
                                    <div class="col-sm-10">
                                        <div class="col-sm-5 no-padding">
                                            <select class="col-xs-10 col-sm-5" name="public" data-placeholder="public" style="width: 100%">
                                                <option value="0" <if condition="$content['private'] eq 0">selected</if> >Public</option>
                                                <option value="1" <if condition="$content['private'] eq 1">selected</if>>Private</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right" for=""><em>*</em>Language:</label>
                                    <div class="col-sm-10">
                                        <div class="col-sm-5 no-padding">
                                            <select class="col-xs-10 col-sm-5" multiple="multiple" name="language[]" data-placeholder="Language" style="width: 100%;height: auto">
                                                <foreach name="language" item="val" key="k">
                                                    <option value="{$val['value']}" <if condition="$content['lang'][$k] eq 1 ">selected="selected"</if>>{$val.name}</option>
                                                </foreach>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Users:</label>
                                    <div class="col-sm-10">
                                        <textarea name="form-required-limit" class="col-xs-10 col-sm-5">{$content.ulist}</textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="" class="col-sm-2 control-label no-padding-right"><em>*</em>Description:</label>
                                    <div class="col-sm-8">
                                        <!-- 加载编辑器的容器 -->
                                        <script id="description" name="description" >{$content.description}</script>
                                        <!-- 配置文件 -->
                                        <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
                                        <!-- 编辑器源码文件 -->
                                        <script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
                                        <!-- 实例化编辑器 -->
                                        <script type="text/javascript">
                                            var ue = UE.getEditor('description',{
                                                toolbars: [[
                                                    'fullscreen', 'source', '|', 'undo', 'redo', '|',
                                                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                                                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                                                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                                                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                                                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', 'emotion',  'insertcode', '|',
                                                    'horizontal', 'date', 'time', 'spechars','|',
                                                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                                                    'print', 'preview', 'searchreplace', 'help', 'drafts'
                                                ]]
                                            });
                                        </script>
                                    </div>
                                </div>
                                <div class="clearfix form-actions">
                                    <div class="col-md-3 col-xs-3"></div>
                                    <div class="col-md-9 col-xs-9">
                                        <button type="submit" class="save-btn btn btn-success"><i class="ace-icon fa fa-check"></i> 保 存 </button>
                                        <button type="button" class="btn btn-grey" onclick="javascript:history.go(-1)"><i class="ace-icon fa fa-close bigger-110"></i> 取 消 </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--/row-->

    </div>

    <!--/row-->

</div>
<!--content-->
<div> </div>

<include file="Public:footer" />
